LIB_AVCODEC  = $(shell pkg-config --libs libavcodec)
LIB_AVUTIL 	 = $(shell pkg-config --libs libavutil)
LIB_AVFORMAT = $(shell pkg-config --libs libavformat)
LIB_NCURSESW = $(shell pkg-config --libs ncursesw)

LIBS 		 = $(LIB_NCURSESW) $(LIB_AVCODEC) $(LIB_AVUTIL) $(LIB_AVFORMAT)

debug_flags  = 

src 		 = main.cpp video_parser.cpp 
inc 		 = video_parser.h
build_dir    = build
target 		 = ascii_player

build: $(build_dir)/$(target)


$(build_dir)/$(target): $(src) $(inc)
	-mkdir $(build_dir)
	g++ $(debug_flags) $(LIBS) $(src) -o $(build_dir)/$(target)

.PHONY: clear run

run: $(build_dir)/$(target)
	-./$(build_dir)/$(target) ./bad_apple.mp4

clear:
	-rm -r $(build_dir)